﻿namespace Api.Shared.Model.Web.Login
{
    public class MySession
    {
        public string? MyToken { get; set; }
        public string? MyToken1 { get; set; }

        public User? user { get; set; }
        public RolesItemNew RolesItemNew { get; set; } = new();

        public List<MenuItemNew> MenuItemsNew
        {
            get => RolesItemNew.children ?? new List<MenuItemNew>();
        }



        public Dictionary<int, int> Mydic { get; set; } = new()
        {
            { 1, 30 },
            { 2, 31 },
            { 3, 32 },
            { 4, 33 },
        };

        public Dictionary<string, int> UsersRole { get; set; } = new()
        {
            { "超级管理员", 30 },
            { "管理员", 31 },
            { "操作员", 32 },
            { "观察者", 33 },
        };

        public Dictionary<int, string> RoleUsers
        {
            get => (this.UsersRole.ToDictionary(x => x.Value, x => x.Key));
        }

    }
}
